//
//  ActionModel.h
//  
//  jhf
//
//  Created by 计海峰 on 2020/3/17.
//  Copyright © 2020 计海峰. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, kTableServiceType) {
    ReloadList = 0, // 传nil // 刷新 整体 tableview
    ReloadSection, // 传 action.key // 刷新 section
    ReloadRow, // 传 action.key // 刷新 row
    RemoveRow, // 传 action.key // 移出row
    RemoveSection, // 传 action.key // 移出section
    HiddenKeyboard, // 传nil // 隐藏键盘
    ReloadData, // 传nil 执行 refresh Data
    ReForRows, // 传nil  执行  forRows
    RefreshRowHeight, // 传  action.key 刷新高度
    RefreshUpdates, // 传  action.key 刷新高度
};

NS_ASSUME_NONNULL_BEGIN

@interface ActionModel : NSObject

// 绑定key
@property (nonatomic, copy) NSString *key;

@property (nonatomic, copy) NSString *bindKey;

@property (nonatomic, copy) NSString *method;

@property (nonatomic, strong, readwrite) id any;

+ (ActionModel *)initBindKey:(NSString *)bindKey;

- (void)configMethod:(NSString *)method any:(_Nullable id)any;

- (void)run:(NSString *)method any:(_Nullable id)any;

- (BOOL)runTarget:(NSObject *)obj;

- (void)runService:(kTableServiceType)service any:(_Nullable id)any;

@end

NS_ASSUME_NONNULL_END
